package com.hrsoft.modules.expert.controller;

import java.util.Arrays;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.hrsoft.modules.expert.entity.ExpertShieldEntity;
import com.hrsoft.modules.expert.service.ExpertShieldService;
import com.hrsoft.common.utils.PageUtils;
import com.hrsoft.common.utils.R;



/**
 * 屏蔽单位名称表
 *
 * @author garfield.yue
 * @email yuedefeng101@163.com
 * @date 2020-05-12 14:37:09
 */
@RestController
@RequestMapping("expert/expertshield")
public class ExpertShieldController {
    @Autowired
    private ExpertShieldService expertShieldService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    // @RequiresPermissions("expert:expertshield:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = expertShieldService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    // @RequiresPermissions("expert:expertshield:info")
    public R info(@PathVariable("id") Long id){
		ExpertShieldEntity expertShield = expertShieldService.getById(id);

        return R.ok().put("expertShield", expertShield);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //  @RequiresPermissions("expert:expertshield:save")
    public R save(@RequestBody ExpertShieldEntity expertShield){
		expertShieldService.save(expertShield);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //  @RequiresPermissions("expert:expertshield:update")
    public R update(@RequestBody ExpertShieldEntity expertShield){
		expertShieldService.updateById(expertShield);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    // @RequiresPermissions("expert:expertshield:delete")
    public R delete(@RequestBody Long[] ids){
		expertShieldService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
